﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Arcana.Contract.Tests.Argument.Is.In
{
    [TestClass]
    public class RangeAttributeTest
    {
        [Arcana.Contract.Argument.Is.In.Range("x", 4.1, 9.0, Exception = typeof(ArgumentOutOfRangeException))]
        public static void Target_1(double x)
        {
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(48)]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void ShouldThrowException_1()
        {
            Target_1(4.0);
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(48)]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void ShouldThrowException_2()
        {
            Target_1(9.1);
        }

        [TestMethod]
        [Owner("arcane_master")]
        [WorkItem(48)]
        public void ShouldPass()
        {
            Target_1(4.1);
            Target_1(9.0);
            Target_1(5.0);
        }
    }
}
